California oil spills
This code visualizes and analyzes spatial data of oil spill events in California in 2008, recorded by the California Department of Fish and Wildlife. An interactive map, a chloropleth map, and a g-function plot are created.
Data citation: California Department of Fish and Wildlife, Office of Spill Prevention and Response. 2020. Oil Spill Incident Tracking [ds394]. https://map.dfg.ca.gov/metadata/ds0394.html
# read in county shape file
counties_sf <- read_sf(here("data", "CA_Counties_TIGER2016.shp")) %>%
janitor::clean_names() %>%
select(name)
# read in oil spills shape file, convert to 3857 projection
oil_spills_sf <- read_sf(here("data", "ds394", "ds394.shp")) %>%
janitor::clean_names() %>%
st_transform(3857)
tmap_mode(mode = "view")
tm_shape(counties_sf) +
tm_borders(col = "black") +
tm_shape(oil_spills_sf) +
tm_dots()